package com.android.tabtestpack;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

import com.android.R;

public class HelloTabWidget extends TabActivity {

	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.tabmain);

	    Resources res = getResources(); // Resource object to get Drawables
	    TabHost tabHost = getTabHost();  // The activity TabHost
	    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
	    Intent intent;  // Reusable Intent for each tab
	    // Create an Intent to launch an Activity for the tab (to be reused)
	     intent = new Intent().setClass(this, Inbox.class);
	     spec = tabHost.newTabSpec("inbox").setIndicator("Inbox",
	    		 res.getDrawable(R.drawable.inbox_state))
            .setContent(intent);
	     	tabHost.addTab(spec);
	     	
	     	intent = new Intent().setClass(this, Outbox.class);
	    		 spec = tabHost.newTabSpec("outbox").setIndicator("Outbox",
     res.getDrawable(R.drawable.outbox_state))
	                  .setContent(intent);
	    tabHost.addTab(spec);
	    
	    
	   	    
	     intent = new Intent().setClass(this, Outbox.class);
	     spec = tabHost.newTabSpec("sendfax").setIndicator("SendFax",
	                      res.getDrawable(R.drawable.sendfax_state))
	                  .setContent(new Intent(this,SendFax.class));
	    tabHost.addTab(spec);
	    
	     intent = new Intent().setClass(this, Outbox.class);
	    spec = tabHost.newTabSpec("sendsms").setIndicator("SendSms",
	                      res.getDrawable(R.drawable.sendsms_state))
	                  .setContent(new Intent(this,SendSms.class));
	    tabHost.addTab(spec);
	    
	     intent = new Intent().setClass(this, Outbox.class);
	     spec = tabHost.newTabSpec("settings").setIndicator("Settings",
	                      res.getDrawable(R.drawable.settings_state))
	                  .setContent(new Intent(this,Settings.class));
	    tabHost.addTab(spec);
	    
	     intent = new Intent().setClass(this, Outbox.class);
	     spec = tabHost.newTabSpec("contacts").setIndicator("Contacts",
	                      res.getDrawable(R.drawable.contacts_state))
	                  .setContent(new Intent(this,Contacts.class));
	    tabHost.addTab(spec);



	    tabHost.setCurrentTabByTag("inbox");
	}
}
